<?php
$useragent = $_SERVER['HTTP_USER_AGENT'];
$pattern = "/silkapp\/(\d+)\.(\d+)/";
$match = array();
preg_match($pattern, $useragent, $match);

$version = $match[1].'.'.$match[2];
$newVersion = $this->hasNew();
?>

<?php if($match && $newVersion): ?>
    <p style="text-align:center;padding-top:0.1rem;">
        <a href='<?php echo "/apk/qslb.{$newVersion}.apk"; ?>' target='_blank'>
            有新版：<?php echo $newVersion;?> 当前版本：<?php echo $version; ?> 点击立即下载
        </a>
    </p>
<?php elseif($match): ?>
	<p style="text-align:center;padding-top:0.1rem;color:#999;">
        版本：<?php echo $version; ?>
    </p>
<?php endif; ?>